import request from '@/utils/request'

const apiName = "admin/dept";

export default {
  getNestedTreeList() {
    return request({
      url: `${apiName}/get-tree-all`,
      method: 'get'
    })
  },
  /**
   * 获取部门下拉列表
   */
  getTreeList() {
    return request({
      url: `${apiName}/get-tree`,
      method: 'get',
    })
  },

  getList(params) {
    return request({
      url: `${apiName}/get-list`,
      method: 'get',
      params: params
    })
  },
  ListExclude(id) {
    return request({
      url: `${apiName}/get/exclude/${id}`,
      method: 'get'
    })
  },
  removeById(id) {
    return request({
      url: `${apiName}/delete/${id}`,
      method: "delete"
    })
  },
  save(dept) {
    return request({
      url: `${apiName}/save`,
      method: "post",
      data: dept
    })
  },
  update(dept) {
    return request({
      url: `${apiName}/update`,
      method: "put",
      data: dept
    })
  },
  getDeptById(id) {
    return request({
      url: `${apiName}/get-dept/${id}`,
      method: "get",
    })
  }
}
